<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>民宿管理系统</title>
    <link rel="stylesheet" href="./views/static/common/layui/css/layui.css">
    <link rel="stylesheet" href="./views/static/admin/css/login.css">
    <script src="./views/static/common/layui/layui.js"></script>
    <script src="views/static/common/jquery-3.3.1.min.js"></script>

</head>


<%
    Object totalCount = application.getAttribute("totalCount");
    if(totalCount == null){
        application.setAttribute("totalCount", 0);
    }else{
        application.setAttribute("totalCount", Integer.parseInt(totalCount.toString()) + 1);
    }
    System.out.println(request.getRemoteHost() + "-" + request.getRemoteAddr() + ":" + request.getRemotePort() + "访问了登录页面");
%>
<body id="login">
<p style="color: #aaaaaa">历史访问人数:<%=application.getAttribute("totalCount")%></p>
<div class="login">

    <h2> <strong><font face="仿宋" >民宿管理系统</font></strong></h2>
    <form class="layui-form" method="post" target="_self" action="/AdminsServlet.do" >

        <input type="hidden" name="action" value="login">

        <div class="layui-form-item">
            <input type="text" name="username"  id="username" placeholder="用户名" class="layui-input" required >
            <i class="layui-icon input-icon">&#xe66f;</i>
        </div>
        <div class="layui-form-item">
            <input type="password" name="password" id="password" placeholder="密码"  class="layui-input" required >
            <i class="layui-icon input-icon">&#xe673;</i>
        </div>
        <div class="layui-form-item">
            <input type="text" name="code" id="syscode" placeholder="验证码"  style="width: 100px" class="layui-input" required >
            <img src="/CodeServlet.do" style="width: 80px;height:38px;position: absolute;top: 2px; left:115px" onclick="this.src='/CodeServlet.do?'+Math.random()" alt="点击更换验证码" title="点击更换验证码" id="codeImg">
<%--            <a href="/login.jsp" style="float: right">看不清？换一张</a>--%>
            <i class="layui-icon input-icon">&#xe673;</i>
        </div>
        <div class="layui-form-item">
            <span style="color: red">${requestScope.msg}</span>
        </div>
        <div class="layui-form-item">
            <button style="width: 100%" class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="login"  name="login" >立即登录</button>

        </div>
        <br>

    </form>
</div>
</body>
</html>
